/**
 * Created by reeves on 2017/4/13.
 */
cheerio = require('cheerio');

Meteor.methods({
    getUrlTitle: function (url) {
        check(url, String);

        try {
            var result = HTTP.call('GET', url, {timeout: 5000});
            html = cheerio.load(result.content);
            return html('title').text();
        } catch (e) {
            return '自动获取标题失败,请手动输入';
        }
    }
});